﻿using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Nantianmen.Core.Stores;
using Nantianmen.Domain.Repositories;

namespace Nantianmen.EntityFrameworkCore
{
    public static class NantianmenEntityFrameworkBuilderExtensions
    {
        public static void UseEntityFrameworkCore<TDbContext>(this IServiceCollection services) where TDbContext : DbContext
        {
            services.AddScoped<DbContext, TDbContext>();
            services.AddScoped<IDestinationStore, DestinationStore>();
            services.AddScoped<IClusterStore, ClusterStore>();
            services.AddScoped<IRouteStore, RouteStore>();
        }
    }
}
